// frontend/src/services/api.ts
import axios from 'axios';

// 定义API响应类型
interface ApiResponse {
  message: string;
  timestamp: string;
}

const api = axios.create({
  baseURL: '/api',  // 生产环境路径
});
export const fetchData = () => api.get<ApiResponse>('/data');
export default api;